{extend name="layout/common_layout" /}
{block name="body"}
    <!--tab标签-->
<div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">投注网站绑定管理</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show" style="min-height:600px;">
                    <form class="layui-form layui-form-pane" action="{:url('admin/userbind/index')}" method="get">
                        <div class="layui-inline">
                        <label class="layui-form-label">会员类型</label>
                        <div class="layui-input-inline">
                            <select name="usertype">
                                <option value="-1" >不限</option>
                                {foreach name="usertype_group" item="co" key="kk"}
                                <option value="{$kk}" {if condition="$Think.get.usertype nheq null"}{heq name="$Think.get.usertype|intval" value="$kk|intval"}selected{/heq}{/if} >{$co}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                        <div class="layui-inline">
                        <label class="layui-form-label">是否vip</label>
                        <div class="layui-input-inline">
                            <select name="isvip">
                                <option value="-1" >不限</option>
                                <option value="0" {if condition="$Think.get.isvip nheq null"}{heq name="$Think.get.isvip|intval" value="0"}selected{/heq}{/if} >否</option>
                                <option value="1"  {if condition="$Think.get.isvip nheq null"}{heq name="$Think.get.isvip|intval" value="1"}selected{/heq}{/if}>是</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">关键词</label>
                        <div class="layui-input-inline">
                            <input type="text" name="keyword" value="{$keyword}" placeholder="请输入关键词" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn">搜索</button>
                    </div>
                </form>
                <hr>

                <table class="layui-table">
                    <thead>
                    <tr>
                        <th style="width: 30px;">ID</th>
                        <th>投注网站账号</th>
                        <th>投注网站</th>
                        <th>手机</th>
                        <th>状态</th>
                        <th>用户类型</th>
                        <th>是否vip</th>
                        <th>vip到期时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {foreach name="user_list" item="vo"}
                    <tr>
                        <td>{$vo.id}</td>
                        <td>
                            {$vo.account}
                        </td>
                        <td>
                            {$vo.bindsite_type}
                        </td>
                        <td>{$vo.mobile}</td>
                        <td>{php}echo $vo['status']==1 ? '<b style="color:#ffcc33">启用</b>' : '禁用';{/php}</td>
                        <td>
                            {if condition="$vo['usertype'] neq 1 "}
                                {$usertype_group[$vo.usertype]}
                            {else condition="$vo['usertype'] eq 1 "}
                                {if condition="$vo['viptime'] lt time()"}
                                    {$usertype_group[5]}
                                {else}
                                    {$vo.viplevel_str}
                                {/if}
                            {/if}
                        </td>
                        <td>{php}echo $vo['isvip']==1 ? '<b style="color:#cc9900">是</b>' : '否';{/php}</td>
                         <td>{php}
                             if($vo['viplevel']==-1) {
                                echo '无限';
                             }elseif($vo['viptime']) {
                                echo date('Y-m-d H:i:s',$vo['viptime']);
                             }
                             {/php}
                         </td>
                        <td>
                            <a href="{:url('admin/userbind/edit',['id'=>$vo['userid']])}" class="layui-btn layui-btn-normal layui-btn-mini">编辑绑定</a>
                        </td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
                <!--分页-->
                {$user_list->render()}
            </div>
        </div>
</div>
{/block}
{block name="script"}
<script>
    $(function(){
       $('.layui-more .layui-icon').on('mouseover',function(){
           layer.tips($(this).parents('.layui-more').find('.layui-more-tip').html(), $(this), {
            tips: [4, 'rgba(0,255,255,0.8)'],
            area: ['300px', 'auto'],
            time: 4000
          });
       });
    });
</script>
{/block}